<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Traits;

use Illuminate\Hashing\BcryptHasher;

trait PwdTool
{
    // 验证密码
    public function verifyPassword(string $password, $hashedValue)
    {
        $bcrypt = new BcryptHasher();

        return $bcrypt->check($password, $hashedValue);
    }

    public function makePassword(string $passwordString)
    {
        return ( new BcryptHasher() )->make($passwordString);
    }
}
